package com.chenyongjing.design.pattern.interpreter.origin;

import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

/**
 * @Author chen
 * @Date 2022/11/27 21:59
 */
public class SpringTest {
    public static void main(String[] args) {
        ExpressionParser parser =new SpelExpressionParser();
        Expression expression = parser.parseExpression("100 * 2 + 400 * 1 + 30");
        Integer result =(Integer) expression.getValue();
        System.out.println("计算结果是："+result);
    }
}
